<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>

    <title>注册页面</title>
    <link type="text/css" rel="stylesheet" href="style.css"/>

</head>
<body>
<div class="xm-logo">
    <i>
        <svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg">
            <rect width="48" height="48" rx="3" ry="3" style="fill:#551fff"></rect>
            <rect x="10" y="15" width="4.2" height="18" style="fill:#FFFFFF"></rect>
            <rect x="33.75" y="15" width="4.2" height="18" style="fill:#FFFFFF"></rect>
            <rect x="11.25" y="15" width="15" height="4.1" style="fill:#FFFFFF"></rect>
            <rect x="26.2" y="20.55" width="4.2" height="12.5" style="fill:#FFFFFF"></rect>
            <rect x="20.6" y="15" width="9.8" height="9.8" rx="4.4" ry="4.4" style="fill:#FFFFFF"></rect>
            <rect x="20.2" y="19" width="6" height="6" rx="2" ry="2" style="fill:#551fff"></rect>
            <rect x="18" y="19.1" width="4" height="2.2" style="fill:#551fff"></rect>
            <rect x="24.2" y="23" width="1.94" height="10" style="fill:#551fff"></rect>
            <rect x="18.1" y="22.8" width="4.2" height="10.2" style="fill:#FFFFFF"></rect>
        </svg>
    </i>
</div>
<h1 class="xm-title">小米账号注册</h1>

<form action="user.php" method="post">
    <ul class="xm-login">
        <li>
            <input class="xm-input" id="phone" name="phone" type="text" placeholder="请输入手机号码"/>
        </li>
        <li>
            <input class="xm-input" id="password" name="password" type="text" placeholder="请输入密码"/>
        </li>
        <li>
            <button class="xm-button" type="submit" id="next">注册</button>
        </li>
    </ul>
</form>

<!--
<script type="text/javascript" src="jquery-3.4.1.js"></script>
<script type="text/javascript">
    $(function () {
        $("#next").on("click", function () {
            var phone = $("#phone").val();
            console.log(phone.length);
            if (11 != phone.length) {
                alert("请输入正确的手机号!");
                return;
            }
            $.ajax({
                url: "https://test.shop.deepe.ren/api/register/verify",
                data: {
                    phone: phone
                },
                dateType: "json",
                type: "post",
                success: function (res) {
                    if (res.status == 200) {
                        alert(res.data.code);//这句弹框验证码只是在调试的时候使用
                        //localStorage 这东西可以帮我们存储在浏览器的本地缓存内
                        //存入手机号码
                        localStorage.phone = phone;

                        window.location.href = "register2.html";
                    }else if(res.status == 400){
                        alert(res.msg);
                    }

                }
            })
        })
    })
</script>
-->

</body>
</html>
